<table cellpadding="2" cellspacing="0" border="0" width="100%">
  <tr>
    <td valign="top" >
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
<%
  tmpDay = (Calendar)currentDate.clone();
  int weekStartDay = sec.getConfigInt("calendar", "General", "Week Start Day");
  if (weekStartDay!=0) // current day
    tmpDay.set(Calendar.DAY_OF_WEEK,weekStartDay);
  tmpDay.set(Calendar.HOUR_OF_DAY,0);
  tmpDay.set(Calendar.MINUTE,0);
  tmpDay.set(Calendar.SECOND,0);

  for(int i = 0; i < 7; i++)
  {
%>
          <tr>
            <td>
              <table cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr  bgcolor=<%
            // Check if it's today
            if ( today.get(Calendar.DAY_OF_YEAR) == tmpDay.get(Calendar.DAY_OF_YEAR)
                  && today.get(Calendar.YEAR) == tmpDay.get(Calendar.YEAR) )
              out.print("#ffffcc");
            else
              out.print("#7EC1F3");
            %>>
                  <td align="left">
                    <font size="-1" face="Arial,Helvetica">
                    	<%=BoxStatic.weekSymbols[tmpDay.get(Calendar.DAY_OF_WEEK)]%>,
                    	<a href="<%=BoxStatic.servletDir%>BoxReservationViewAction?VIEW_FORMAT=DAY&t=<%=tmpDay.getTime().getTime()%>">
                    	<b><%=StringUtil.getDateTimeFormatString(sec.getTimeZone(), BoxStatic.LONG_DATE_FORMAT, tmpDay.getTime())%></b></a>
                   </font>
                  </td>
                  <td nowrap align="right" width="1%"><font size="-3" face="Arial,Helvetica">
                    <a href="<%=BoxStatic.servletDir%>BoxReservationAction?SubmitEdit=edit&t=<%=(tmpDay.getTime().getTime()+1000*60*60*workStartHour)%>">New</a> </font>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
<%
    Iterator it = null;
    if (RESOURCECATID == -1 && RESOURCEID == -1)
      it = home.getAllEntries(tmpDay, curUserID, VIEW_MINE!=0, SORTBY, sortAsc);
    else if ( RESOURCECATID != -1 )
      it = home.getEntriesByCat(tmpDay, curUserID, VIEW_MINE!=0, RESOURCECATID, SORTBY, sortAsc);
    else
      it = home.getEntries(tmpDay, curUserID, VIEW_MINE!=0, RESOURCEID, SORTBY, sortAsc);

    if ( it != null && it.hasNext())
    {
%>
    <tr><td>
      <table width="100%">
    		<Common:Iteration name="entry" type="BoxReservationEntry" group="<%=it%>">
        <tr bgcolor="white">
          <font size="-1">
          <td valign="top" align="left">
             &nbsp;&nbsp;&nbsp;
<% 					if (entry.getRepeat())
            {
%>
              <IMG SRC="<%=BoxStatic.imageDir%>cal_repeat.gif" WIDTH=13 HEIGHT=12 BORDER=0 >
<%					 }%>
             <a href="<%=BoxStatic.servletDir%>BoxReservationAction?SubmitEdit=edit&ID=<%=entry.getID()%>&t=<%=tmpDay.getTime().getTime()%>"><%=home.getEntryString(entry, SORTBY, sec.getTimeZone())%></a>
           </td>
           <td align="right" width="1%">
<%
             if (isAdminUser || curUserID.compareTo(entry.getUserID())==0 )
             {
%>
                <a href="<%=BoxStatic.servletDir%>BoxReservationAction?SubmitDelete=del&ID=<%=entry.getID()%>"
                Onclick='return confirmDel("<%=entry.getSubject()%>")'
                >Delete</a>
<%
              }
              else
              out.print("&nbsp;");
%>
            </font>
            </td>
          </tr>
    		</Common:Iteration>
    	</table>
		</td></tr>
<%
    }
    else
    {
       out.print("<tr> <td bgcolor=\"#eeeeee\"><br> </td> </tr>");
    }
    tmpDay.add(Calendar.DATE,1);
  }
%>
        </table>
        </td>
      </tr>
    </table>
    </td>
  </tr>
</table>
